import os


class BatchReName:
    def __init__(self, path):
        self._path = path
        pass

    def doExcute(self, prefix):
        listDir = os.listdir(self._path)
        index = 1
        for fileName in listDir:
            fullName = self._path + "/" + fileName
            if os.path.isdir(fullName):
                pass
            elif os.path.isfile(fullName):
                fileEx = fileName.split(".")
                pureName = fileEx[0]
                ex = fileEx[1]
                newName = prefix + str(index) + "." + ex
                os.rename(fullName, self._path + "/" + newName)
                index += 1
                pass


if (__name__ == "__main__"):
    batch = BatchReName("png")
    batch.doExcute("equip")
